﻿#include <iostream>
#include "dictionary.h"
int main()
{
    std::string textName = std::string(), word = std::string();
    std::cout << "输入需要分析的文件名: ";
    std::cin >> textName;
    dictionary dict = dictionary(textName);
    for (;;)
    {
        std::cout << "输入要查询的单词(输入__EXIT__退出查询):";
        std::cin >> word;
        if (word == "__EXIT__")
        {
            break;
        }
        std::cout << "文章内包含" << word << "的个数为: " 
            << dict.query(word) << std::endl;
    }
    return 0;
}
